Inno Setup
Frequently Asked Questions

Last Updated: 2001-08-14

Following are answers to some of the top questions I receive regarding Inno Setup.

Functionality

Problems

Installation Tasks

How Do I Install...?

Compatibility

Miscellaneous


Functionality

Translating Inno Setup's Text

Translating Inno Setup's text into another language does not require modifying the source code. Simply make a copy of the Default.isl file (included with Inno Setup) and start editing the text in it. (Do not directly edit the Default.isl file, as doing so may cause Inno Setup binary patches to not install properly.) See the "[Messages] Section" topic in the Inno Setup help file for some important tips.

Once you have finished creating the new .isl file, add a MessagesFile directive to your script's [Setup] section, to tell the compiler to use it:

[Setup]
MessagesFile=compiler:MyTranslation.isl

There are many contributed translations available for download on the Inno Setup Third-Party Files page, as well as a program to assist in editing the .isl file.

Does it support MBCS (multi-byte character sets)?

Inno Setup 2.0.6 adds complete support for MBCS. It does lead byte checking on all filename and constant parsing, so it should no longer mistake trail bytes for backslashes ("\") or braces ("{").

Versions prior to 2.0.6 did not include any special support for MBCS.

Will it support Windows Installer in the future?

At the present time, I do not have plans for a Windows Installer edition of Inno Setup.

How do I change the icon of Setup.exe?

This is not currently possible. However, I do intend to add an option for this in one of the next releases. This option would probably be NT/2000-only, since Windows 95/98 lack the UpdateResource function which automates the process of changing resources in compiled EXEs.

But for now, there are some third-party programs such as ReplaceIcon, Microangelo, and Resource Hacker which are capable of changing the icon of Setup.exe.

Can Inno Setup do a conditional installation - for example, proceed only if a certain registry key or file exists?

This sort of thing is not currently possible, but should be sometime in the future. Martijn Laan has been working on it in his My Inno Setup Extensions.

Note: It is currently possible to install different files depending on the Windows version.

Can Setup ask for a user and company name, or other additional information?

This is not currently possible, but may be in the future.

Problems

Compiler says "Mismatched or misplaced quotes on parameter"

This message is typically displayed if you try to embed a quote (") character in a parameter's data, but do not double it as required. Read the "Parameters in Sections" topic in the Inno Setup help file for more information.

My application can't find any of its files when it is started from the shortcut created by Setup. It works fine when I double-click the application's EXE in from Explorer.

Your application is most likely not specifying pathnames on the files it is trying to open, so it is expecting to find them in the current directory. Inno Setup by default will not set the "Start In" field of shortcuts, meaning Windows picks a current directory itself, which usually won't be the same directory as your application. Working around this is a trivial task; a "WorkingDir: {app}" parameter simply needs to be added to the [Icons] entry.

However, I would not recommend that as the best solution. In most cases, applications should not expect to be started from a particular directory. They should always specify full pathnames on files they open. In Delphi or C++Builder it's possible to get the full pathname of the directory containing the EXE by calling: ExtractFilePath(ParamStr(0)). If, for example, you wanted to reference a file named "File.txt", you would use: ExtractFilePath(ParamStr(0)) + 'File.txt'.

Setup gives the message "Unable to register the DLL/OCX: DllRegisterServer export not found"

This message normally means that you specified the "regserver" flag on a file that doesn't possess the ability to be registered. Remove the "regserver" flag from the [Files] entry and the message will go away.

After uninstalling, the directories created during installation still exist.

In Inno Setup versions prior to 2.0.1, directories must be specified in either the [Dirs] or [UninstallDelete] sections for them to be deleted by the uninstaller. In newer Inno Setup versions, directories created by [Files] section entries will be deleted automatically by the uninstaller if they didn't exist prior to installation.

I run a batch file in the [Run] section, but the window remains on the screen after it finishes executing. I'd like it to "close on exit."

From Tim Rude:
The simplest way to get a batch file to automatically close on exit is to clear the screen at the end of it using the CLS command.

--- batch file 1 ---

@echo off
echo Hello World
echo This batch file does NOT close on exit

--- batch file 2 ---

@echo off
echo Hello World
echo This batch file DOES close on exit
cls

I've changed DefaultDirName in my script, yet when I run Setup it wants to install to the old directory.

This isn't a bug, but a feature. At startup Setup will look in the registry to see if the same application is already installed, and if so, it will use the directory of the previous installation as the default directory presented to the user in the wizard. If you uninstall the application and run Setup again, it should use the new DefaultDirName setting. If you wish to disable this feature, set UsePreviousAppDir to "no".

I have two [Icons] entries with the same Name, but only one of them gets installed.

Two files can't have the same name, therefore two shortcuts can't have the same name.

Setup isn't waiting for a program executed by a [Run] entry to finish.

First, verify that are not using the "nowait" or "waituntilidle" flags on the [Run] entry. These flags cause Setup to not wait until the process completely terminates.

If you aren't using those flags and it still doesn't seem to be waiting for the program to finish, then likely what is happening is that the EXE you're running is spawning some other process and then terminating itself immediately, causing Setup to think the program has finished. This is known to happen with older InstallShield installers.

A simple way to check if a program does that is to run "START /WAIT ProgramName.exe" from the command line, and see if you are returned to the command prompt before the program exits.

Installation Tasks

Creating Internet (URL) Shortcuts

First create a file named, for example, "website.url", and place these lines inside it:

[InternetShortcut]
URL=http://web.site.address/

Then add these lines to your script:

[Files]
Source: "website.url"; DestDir: "{app}"

[Icons]
Name: "{group}\Visit My Web Site"; Filename: "{app}\website.url"

Creating Shortcuts on the Quick Launch Bar

Upgrade to at least Inno Setup 1.3.11, then use:

[Icons]
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\My Program"; Filename: "{app}\MyProg.exe"

Setting the "Start In" Field on a Shortcut

Use a WorkingDir parameter on the [Icons] section entry.

Creating File Associations

First set the [Setup] section directive "ChangesAssociations" to "yes". Then create [Registry] entries as shown below.

[Registry]
Root: HKCR; Subkey: ".myp"; ValueType: string; ValueName: ""; ValueData: "MyProgramFile"; Flags: uninsdeletevalue

".myp" is the extension we're associating. "MyProgramFile" is the internal name for the file type as stored in the registry. Make sure you use a unique name for this so you don't inadvertently overwrite another application's registry key.

Root: HKCR; Subkey: "MyProgramFile"; ValueType: string; ValueName: ""; ValueData: "My Program File"; Flags: uninsdeletekey

"My Program File" above is the name for the file type as shown in Explorer.

Root: HKCR; Subkey: "MyProgramFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MYPROG.EXE,0"

"DefaultIcon" is the registry key that specifies the filename containing the icon to associate with the file type. ",0" tells Explorer to use the first icon from MYPROG.EXE. (",1" would mean the second icon.)

Root: HKCR; Subkey: "MyProgramFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MYPROG.EXE"" ""%1"""

"shell\open\command" is the registry key that specifies the program to execute when a file of the type is double-clicked in Explorer. The surrounding quotes are in the command line so it handles long filenames correctly.

Setting the "Close on Exit" Box on a Shortcut to an MS-DOS Program

Inno Setup version 1.3.15 and later includes support for "closeonexit" and "dontcloseonexit" flags in the [Icons] section.

Making Backups Before Replacing Files

Inno Setup does not currently have a specific feature for doing that, but you can make a copy of a file before it is replaced by using a [Files] section entry similar to this:

Source: "{app}\MyProg.exe"; DestDir: "{app}\backup"; Flags: external skipifsourcedoesntexist uninsneveruninstall

Installing Different Files Depending on Windows Version

That can be done via MinVersion and/or OnlyBelowVersion parameters on an entry. See the Common Parameters topic in the documentation for details.

Here is a simple example of how to install one file on NT platforms (Windows NT/2000/XP) and another file on non-NT platforms (Windows 95/98/Me):

[Files]
Source: "{app}\WinNT2000.exe"; DestDir: "{app}"; MinVersion: 0, 1
Source: "{app}\Win9598Me.exe"; DestDir: "{app}"; MinVersion: 1, 0

"0" means never install; "1" means install on any version (i.e. version 1.0 or later).

Note: The above technique isn't limited to the [Files] section; MinVersion and OnlyBelowVersion can be used in most sections.

My installation needs to do something that Inno Setup apparently doesn't have a feature for.

See the How-To article Implementing Custom Functionality.

How Do I Install...?

OCX Files

The recommended way to install OCX files is as follows. (Note: The following is a single line.)

Source: "ComCtl32.ocx"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: restartreplace sharedfile regserver

Visual Basic System Files

With VB 3.0 and earlier it's easy -- just copy the appropriate VBRUN???.DLL file to the user's system directory and you're done. For VB 4.0, I don't know. For VB 5.0 and 6.0, see this How-To article.

Visual C++ System Files (e.g. MFC)

See this How-To article.

COMCTL32.DLL

You can direct your users to download the COMCTL32 update from Microsoft, or distribute the COMCTL32 update along with your program. Microsoft does not allow separate redistribution of COMCTL32.DLL (and for good reason), so you should never place COMCTL32.DLL in a script's [Files] section.

BDE (Borland Database Engine)

See the How-To article Installing BDE for details on deploying the 32-bit version of BDE using Inno Setup.

MDAC, ADO, Jet, etc.

See this How-To article.

Compatibility

OS Compatibility

Currently supported platforms include Windows 95, 98, Me, NT 3.51, NT 4.0, and 2000.

I currently use and develop on Windows 2000 primarily, so Windows 2000 compatibility is foremost.

When new major features are introduced, I usually test them personally on all supported Windows versions.

The 16-bit version of Inno Setup has been discontinued starting with version 1.3. The older 1.2.x version is still available for download, though, if you really need a 16-bit installer.

Y2K Compliance

Inno Setup has been fully Y2K compliant ever since version 1.09 at least. Prior versions of Inno Setup most likely were Y2K compliant too, but I have not gone back and tested them.

The only time the installer looks at dates is when it compares time stamps on files it copies. And the only time this is done is when processing [Files] section entries that use the comparetimestamp flag. The 16-bit version of Inno Setup 1.11i and later can properly handle files with years up to 2107, the maximum for the 16-bit Windows API (versions prior to 1.11i supported years up to 2043). The 32-bit version of Inno Setup has had no limit on the year since version 1.09.

Windows NT/2000 & Administrative Privileges

A typical Inno Setup installation running on Windows NT or 2000 does not require administrative or "power user" privileges. However, there are exceptions as noted below.

Things that require administrative privileges on both Windows NT and 2000:

Things that require either administrative or "power user" privileges on Windows 2000:

Inno Setup itself does not require write access to the WINNT directory, or any other registry keys not mentioned above.

What is different when an installation is run by a user without administrative privileges?


Miscellaneous

Are there any limits on how many files, etc. may be included in an installation?

Inno Setup places no arbitrary limits on how many files, shortcuts, registry entries, etc. that you may include in an installation. However, keep in mind that Setup does need memory for each entry in a script. For example, roughly 120 bytes of memory is needed for each [Files] entry.

The total size of all files in an installation currently cannot exceed 2 GB, because it does not use 64-bit arithmetic in several places. If you try to use more than 2 GB, the free disk space check and/or progress bar will not work properly. I plan to address this in the future.

What exactly happens when the user clicks Cancel during an installation?

When Cancel is clicked, Setup will begin reverting changes it's made so far in the very same manner as the Uninstall program. Thus, a partially installed application isn't left over.

What does the name "Inno Setup" mean?

It was actually short for "Innovative Setup". (So it's pronounced IN-NO, not EYE-NO.) This was a name I assigned to it when I first started development on it and it stuck. :)